package org.chen.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class DashboardStatisticsVO {
    private Statistics statistics;
    private List<ArticleVO> recentArticles;
    private List<CrawlerTaskVO> crawlerTasks;

    @Data
    public static class Statistics {
        private Long totalArticles;      // 总文章数
        private Long crawlerArticles;    // 爬虫文章数
        private Long totalImages;        // 图片资源数
        private Long crawlerTasks;       // 爬虫任务数
    }

    @Data
    public static class ArticleVO {
        private String id;
        private String title;
        private String type;      // admin/crawler
        @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
        private Date createTime;
    }
}